﻿using System;
using Microsoft.Xna.Framework;

namespace MainJumpFleet.SteerBehaviors
{
    public class KinWander : KinematicMovement
    {
        public float rotation;
        Random r = new Random();
        float change;
        public override void getSteering(OakEngine.AI.Steering.Oak_Steering steer)
        {
            // Move forward in the current direction
            steer.ForwardVector = this.location.GetRotationAsVelocity();
            steer.ForwardVector *= this.speed;

            // Turn a little
             change += (float)MathHelper.Lerp(-1.25f, 1.25f, (float)r.NextDouble()); ;
            steer.Rotation = change * rotation;
        }
    }
}
